home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
pock41.zip
/
DEMO.BAT
< prev
next >
Wrap
DOS Batch File
|
1994-06-01
|
14KB
|
397 lines
echo off
cls
d /Yny// /'//@tThis is a DEMO for the program D.EXE (&WPocketD&w)//@tDo you want to proceed (Y@/N) ?'
if not errorlevel 2 goto fin
echo This demonstration shows a small sample of D.EXE's features. The user is
echo advised to run MENUD.EXE for a complete interactive demonstration of the
echo full range of features, and to run README for illustrative examples.
echo All files other than the original PocketD release files will be ignored.
echo D.EXE's internal screen size is set to 80 cols by 11 rows for demonstration
echo purposes. ( The menus below are all directly controlled by D.EXE ).
set d_opt2=/#80,11p:.d.exe /:.d.exe/- wh* .pcx
set _=1
if "%_%"=="1" goto envok
echo Not enough environment space!
goto fin1
:envok
d /@n
if errorlevel 21 goto main2
echo Sorry! Demo requires full installation!
goto fin1
:main
cls
echo Returning to main menu..
:main2
d /Y_12345 /'//@t1. Directory formats/@t2. Template/@t3. File information/@t4. File selection/@t5. Help//@tESC exit//@t?'
if errorlevel 6 goto help
if errorlevel 5 goto select
if errorlevel 4 goto stats
if errorlevel 3 goto templ
if errorlevel 2 goto disp
goto exit
:disp
cls
d /Y1234 /'//@tChoose://@t1. Normal,@/w,@/m and @/t format/@t2. Bestfit/@t3. Subdir summary/@t4. Tailoring//@tESC cancel//@t?'
cls
if errorlevel 4 goto tail
if errorlevel 3 goto subdir
if errorlevel 2 goto bestfit
if errorlevel 1 goto wmt
goto main
:wmt
echo This is the default format: standard details sorted by file/dir name
echo D
d /K.31
echo.
pause
cls
echo This is the /w "wide" format giving only filename and size in KBytes
echo D /w
d /w
echo.
pause
cls
echo This is the /m "minimum" format giving only the filename
echo D /m
d /m
echo.
pause
cls
echo This is the /t "tiny" format grouping files by extension
echo D /t
d /t
echo.
pause
goto disp
:bestfit
echo This is the "Best-fit" format which automatically chooses the display format.
echo In this case /w format is chosen to fit the 80x11 format used by the demo.
echo D /b
d /b~.20
echo.
pause
cls
echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
echo In this case the layout is altered to 3 columns which still fits inside 11 rows.
echo D /b/.k
d /b~.20/.k
echo.
pause
goto disp
:subdir
echo This demonstrates some of the subdirectory summary features of PocketD
d /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
if not errorlevel 2 goto disp
echo D N*.BAT D*.BAT /cc ATEMP1 ( command used for copy/create )
d n*.bat d*.bat /cc atemp1
echo.
md atemp2
echo Subdirs ATEMP1 and ATEMP2 created
pause
cls
echo The following uses /r to include a summary of the contents of subdir ATEMP1
echo and ATEMP2
echo D /r
d /rK.28
echo.
pause
cls
echo The following uses /S and /G to group contents of subdirs
echo D /wSG
d .\AT* *.* /wSG~.35
echo.
pause
cls
d /Y// /'//Deleting temporary files.'
echo D atemp1 atemp2 /zd ( command used to delete )
d atemp1 atemp2 /Ihzd
echo.
pause
goto disp
:tail
echo PocketD offers 19 tailoring options. The following shows four of these:
echo 1. Unbroken names 2. 1jan91 date format 3. Lowercase 4. Sorting by row
echo D /.umlr
d /.umlr/~.28
echo.
pause
goto disp
:templ
cls
echo PocketD has a very powerful TEMPLATE facility that can be used for display
echo or execution purposes. It can accept 50 possible parameters, a few shown below.
d /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
cls
if errorlevel 2 goto t_exec
if errorlevel 1 goto t_disp
goto main
:t_disp
echo The display template can be used in many ways. The simple example at the
echo bottom of the screen simply outputs an X for each matching file/dir.
echo D /w
d /w
echo.
echo D [X]
d [X]
echo.
pause
cls
echo The template can accept parameters such as $f giving the filename
echo D [$f ]
d [$f ]
echo.
echo.
echo It can also accept formatted field widths e.g. $16f for padding to width 16
echo D [$16f]
d [$16f]
echo.
pause
cls
echo $10n gives only the name part without the extension, padded to width 10:
echo D [$10n]
d [$10n]
echo.
echo.
echo "//" in the template will add a newline:
echo D ?????.* [$10n//]
d ?????.* [$10n//]
echo.
pause
goto templ
:t_exec
echo PocketD can be used to run a template for a selected group of files. For
echo example, the following could be used to move each file extension group to
echo its own archive file. The $e option gives the extension part of the name.
echo (R? below causes PocketD to echo each line without running it. R runs).
echo D /e [PKZIP -m $e *.$e]R?
d /e [PKZIP -m $e *.$e]R?
echo.
pause
cls
echo PocketD can run multi-line sequences. e.g. To move each file extension
echo group to its own subdir, named by the extension:
echo D /e [md $e//copy *.$e $e]R?
D /e [md $e//copy *.$e $e]R?!E- *.d*
echo.
pause
cls
echo PocketD can use separate templates for display and execution. This allows
echo the user to browse the display template as a scrolling menu. In the example
echo below $3# provides a file number, $F number of files, $d date, $t time, $s
echo size. The 2nd template starts with [? indicating that it is a display template.
echo The "((" template divider provides a section to appear for the 1st match only.
echo The "Q" option turns the template into a menu (also allowing file viewing etc.).
echo D [pkzip -m save $w][? Choose from://(($3# of $F: $d $t $7s $13w Archive?]RQ
d [ Choose from://(($3# of $F: $d $t $7s $13w Archive?]?~.10
echo.
pause
cls
echo PocketD can run alternative templates to give the user the choice of tasks.
echo The example below allows the user to either move a file to an archive AND/OR
echo copy it to drive A:. The user types "1" to execute the 1st template and "2"
echo for the 2nd. This example could have used 2 display templates, giving 4 in all.
echo D [pkzip -m save $w][copy $w A:][? $15w (1) Move to Archive (2) Copy to A:]QR
D [ $15w (1) Move to Archive (2) Copy to A:]?~.10
echo.
echo From this it can be seen that PocketD's templates potentially offer the user a
echo great deal of power for file management. The user is recommended to follow
echo the detailed examples given in the on-line guide, accessed by typing D /??
pause
goto templ
:stats
cls
echo PocketD can provide additional information about files and present file
echo data in a number of ways. The following gives a few examples of this.
d /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size and Compression/@t3. Extension summary//@tESC cancel//@t?'
cls
if errorlevel 3 goto exten
if errorlevel 2 goto exec
if errorlevel 1 goto bar
goto main
:bar
echo The following chart show the relative size of all files represented as a
echo bar chart. (only 1st 14 files shown).
echo D /g
d /gK.14
echo.
pause
cls
echo The chart is improved by sorting the files by size (ss) & showing the relative
echo percentage usage of each (%%). It also shows the size in terms of space used
echo rather than actual size (U). If /r were added (and subdirectories were present)
echo then the relative sizes of the subdirectories would be plotted.
echo D /ss /%%U /g (or D /ss/%Ug- *.BAT etc..)
d /ss/%%UgK.13
echo.
pause
goto stats
:exec
echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
echo Executable files can be compressed by PKLITE, DIET, COMPACK and LZEXE. The
echo /C option shows which files are compressed by flagging as p,d,c or l
echo D /EMC ( E=executable M=exec size C=Compress check )
d /EMC
echo.
pause
goto stats
:exten
echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
echo to assess the space used by each ex